package eu.goldenak.ircbot.module;

import eu.goldenak.ircbot.IrcBot;

public interface ModuleCallbacks {
	
	/**
	 * Someone changed his/her nickname. Note that this event doesn't supply
	 * the channel(s) it occurred in.
	 */
	public void onChangeNick (IrcBot pBot, String sOldNick, String sNewNick);
	
	/**
	 * The topic of a channel has been changed.
	 */
	public void onChangeTopic (IrcBot pBot, String sChannel, String sNickname, String sNewTopic);
	
	/**
	 * When joining a channel, you get sent a bit of info, including the topic.
	 * That gets handled in here.
	 */
	public void onChannelTopic (IrcBot pBot, String sChannel, String sTopic);
	
	/**
	 * When joining a channel, you also get a list with the names who are
	 * currently in the channel. Note that prefixes are in the names (~&@%+).
	 */
	public void onChannelNames (IrcBot pBot, String sChannel, String sNames);
	
	/**
	 * Someone joined a channel.
	 */
	public void onChannelJoin (IrcBot pBot, String sChannel, String sNickname);
	
	/**
	 * Someone was kicked from a channel by someone.
	 */
	public void onChannelKick (IrcBot pBot, String sChannel, String sKicked, String sKicker, String sReason);
	
	/**
	 * A mode has been set on a channel or on the bot itself.
	 */
	public void onChannelMode (IrcBot pBot, String sChannel, String sMode);
	
	/**
	 * Someone left the channel.
	 */
	public void onChannelPart (IrcBot pBot, String sChannel, String sNickname, String sMessage);
	
	/**
	 * A PRIVMSG event in a channel. For personal PRIVMSGs see onPrivmsg().
	 */
	public void onChannelPrivmsg (IrcBot pBot, String sChannel, String sNickname, String sMessage);
	
	/**
	 * This method gets called as soon as we are connected and logged in to the 
	 * IRC server.
	 */
	public void onConnect (IrcBot pBot);
	
	/**
	 * This method gets called when someone sends us a client-to-client protocol
	 * message (prefixed and suffixed by a 0x01 char).
	 */
	public void onCTCP (IrcBot pBot, String sChannel, String sNickname, String sType, String sMessage);
	
	/**
	 * As soon as we get an invitation to join a channel this method gets 
	 * called.
	 */
	public void onInvite (IrcBot pBot, String sInviter, String sInvitee, String sChannel);
	
	/**
	 * When we receive a notice, this callback will be executed.
	 */
	public void onNotice (IrcBot pBot, String sChannel, String sNickname, String sMessage);
	
	/**
	 * A personal PRIVMSG.
	 */
	public void onPrivmsg (IrcBot pBot, String sNickname, String sMessage);
	
	/**
	 * Someone quit from the IRC server. Note that this event doesn't have a 
	 * channel in it.
	 */
	public void onQuit (IrcBot pBot, String sNickname, String sMessage);
	
	/**
	 * This method will get called everytime a message is received. If you're 
	 * considering on using this, you're probably looking for 
	 * onUnhandledCommand().
	 */
	public void onRaw (IrcBot pBot, String sRaw);
	
	/**
	 * This method will be called after a message has been sent to the IRC
	 * server.
	 */
	public void onRawSend (IrcBot pBot, String sRaw);
	
	/**
	 * This method will be called when the bot shuts down. This because of the
	 * lack of destructors in Java.
	 */
	public void onShutdown (IrcBot pBot);
	
	/**
	 * This method will be called with every loop the main loop makes. Use this
	 * for polling stuff or something.
	 */
	public void onTick ();
	
	/**
	 * This method will be called whenever a message with an unknown IRC event
	 * has been received. Use this when is no callback for the type of message
	 * you want to process.
	 */
	public void onUnhandledCommand (IrcBot pBot);
}